import utils  from '@utils/index'

//check_order 页面产生订单id ->调用订单支付接口
export const addOrder = function(data) {
    return utils.service({
        url: '/m/order/add',
        method: 'post',
        data: data
    });
}

export const payOrder = function(data) {
    return utils.service({
        url: '/m/order/pay/'+data.id,
        method: 'get'
    });
    // 唤起JSSDK 支付流程
}

export const productDetailBuyNow = function(data) {
    /*
    * productItemId
    * number
     */
    return utils.service({
        url: '/m/product/pay',
        method: 'post',
        data
    });
}

export const cartBuy = function(data) {
    //ids [cartId]
    return utils.service({
        url: '/m/shoppingcart/pay',
        method: 'post',
        data
    });
}